#pragma once

class CBlend
{
public:
	CBlend(BYTE nTransparence, BYTE nAlphaFormat = AC_SRC_OVER)
	{
		m_blend.BlendOp = AC_SRC_OVER;
		m_blend.BlendFlags = 0;
		m_blend.SourceConstantAlpha = nTransparence * 255 / 100;
		m_blend.AlphaFormat = nAlphaFormat;
	}

	operator BLENDFUNCTION&()
	{
		return m_blend;
	}

	operator const BLENDFUNCTION&() const
	{
		return m_blend;
	}

protected:
	BLENDFUNCTION m_blend;
};